<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h2>记事本</h2>
        <div class="main">
            <input type="text" />
            <ul>
                <li v-for="(item index) in list" :key="item.id">
                    <div class="content"><span>{{index + 1}}</span>{{item.name}}</div>
                    <button>X</button>
                </li>
            </ul>
            <p class="empty">空空如也</p>
        </div>
    </div>
    <script src="../../js/vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
                list:[
                    {id:1,name:"吃饭"},
                    {id:2,name:"睡觉"},
                    {id:3,name:"还吃"}
                ]
            }
                
        })
    </script>
</body>
</html>